package com.example.homeworkmutualevaluation.Entity;

import com.example.homeworkmutualevaluation.Entity.PrimaryKey.SubmitPK;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.IdClass;
import jakarta.persistence.Table;
import lombok.Data;

import java.sql.Timestamp;

@Entity
@Table(name = "submit")
@IdClass(SubmitPK.class)
@Data
public class Submit {
    @Id
    private String sphone;
    @Id
    private int homeworkid;
    private String content;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Timestamp datetime;
    private int evnumber;
    private double score;
    public Submit() {}
    public Submit(String sphone, int homeworkid, String content) {
        this.sphone = sphone;
        this.homeworkid = homeworkid;
        this.content = content;
    }
}
